package com.cykj.web.controller.posbiz;

import com.cykj.common.annotation.Log;
import com.cykj.common.core.controller.BaseController;
import com.cykj.common.core.domain.AjaxResult;
import com.cykj.common.core.domain.model.LoginUser;
import com.cykj.common.core.page.TableDataInfo;
import com.cykj.common.enums.BusinessType;
import com.cykj.common.utils.ServletUtils;
import com.cykj.common.utils.poi.ExcelUtil;
import com.cykj.framework.web.service.TokenService;
import com.cykj.pos.domain.BizChannel;
import com.cykj.pos.domain.BizMerchant;
import com.cykj.pos.domain.BizWallet;
import com.cykj.pos.profit.dto.MerchantDTO;
import com.cykj.pos.profit.dto.MerchantDict;
import com.cykj.pos.service.IAizStatisticalMerchantService;
import com.cykj.pos.service.IAllocationRelationService;
import com.cykj.pos.service.IBizMerchantInfoService;
import com.cykj.pos.service.IBizMerchantService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

/**
 * 线下操作业务
 */
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/under/task" )
public class BizUnderTaskController extends BaseController {

    @Autowired
    private IBizMerchantInfoService iBizMerchantInfoService;

    @Autowired
    private IAllocationRelationService iAllocationRelationService;

    @Autowired
    private IAizStatisticalMerchantService iAizStatisticalMerchantService;


    @PostMapping("/add/channel/about")
    private AjaxResult addChannelAbout(@RequestBody BizChannel bizChannel){
        return iBizMerchantInfoService.addChannelAbout(bizChannel);
    }

    @PostMapping("/update/flow")
    public AjaxResult updateFlow(){
        return iAllocationRelationService.updateFlow();
    }


    @PostMapping("/merchantChannelStatistic")
    public AjaxResult  merchantChannelStatistic(){
        return iAizStatisticalMerchantService.merchantChannelStatistic();
    }
}
